package cn.z2huo.demo.jakarta.validation.model.dto;

import cn.z2huo.demo.jakarta.validation.annotation.InStringList;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.util.List;

/**
 * <p>
 *
 * @author z2huo
 */
@Data
public class TestReqDTO {

    @NotBlank(message = "name 字符串 不能为空")
    private String name;

    @Min(value = 1, message = "age integer 最小值为1 不能比1更小")
    @Min(value = 3, message = "age integer 最小值为3 不能比3更小")
    private Integer age;

    @Max(value = 10, message = "age integer 最大值为10 不能比10更大")
    private Integer maxInteger;

    @NotNull(message = "list string 不能为null")
    private List<String> stringList;

    @NotEmpty(message = "list Integer 不能为空列表")
    private List<Integer> integerList;

    @AssertFalse(message = "boolean 不为false")
    private boolean studentFlag;

    @Email(message = "not a email")
    private String email;

    @InStringList(values = {"1", "2", "3"}, message = "in string list, 入参不在指定list中")
    private List<String> inStringList;

}
